<?php
class GiaDichvuUserdao extends Controller{
	
	public static function setGia($model){
		$item = GiadichvuUser::model()->findByAttributes(array('iduser'=>$model->iduser, 'iddichvu'=> $model->iddichvu));
		if($item == null){
			$model->save();
		}else{
			$item->gia = $model->gia;
			$item->update();
		}
	}
	
	public static function getlistByidUser($iduser){
		$criteria=new CDbCriteria;
		$criteria->compare('iduser', $iduser);
		return GiadichvuUser::model()->findAll($criteria);
	}
}